﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Account.aspx.cs" Inherits="Account" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
    <a href="Insert Account.aspx" style="color: #FF0000">Add Account</a>
        <asp:GridView ID="GridView1" runat="server" DataKeyNames="Username" AutoGenerateEditButton ="true" AutoGenerateColumns ="false"
         OnRowCancelingEdit="CancelRecord" OnRowEditing="EditRecord" OnRowDeleting="DeleteRecord" OnRowUpdating="UpdateRecord">

        <HeaderStyle BackColor ="LightBlue" ForeColor="White" />
        <EditRowStyle BackColor ="Aqua" />
        <SelectedRowStyle BackColor="Cyan" />

        <Columns>
            
            <asp:TemplateField HeaderText="User name">
                <ItemTemplate><%# Eval("Username")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtusername" runat="server" Text='<%# Eval("Username")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="pass">
                <ItemTemplate><%# Eval("pass")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtpass" runat="server" Text='<%# Eval("pass")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Identification">
                <ItemTemplate><%# Eval("Identification")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtIdentification" runat="server" Text='<%# Eval("Identification")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Date Registry">
                <ItemTemplate><%# Eval("date_Registry")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtdate_Registry" runat="server" Text='<%# Eval("date_Registry")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Acount Type">
                <ItemTemplate><%# Eval("AcountType")%></ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtAcountType" runat="server" Text='<%# Eval("AcountType")%>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Delete">
            <ItemTemplate>
                <span onclick='return confirm("Do you want to delete record?")'>
                    <asp:LinkButton ID="linkDelete" runat ="server" CommandName="Delete" Text="Delete"></asp:LinkButton>
                </span>
            </ItemTemplate>
        </asp:TemplateField>

        </Columns>

        </asp:GridView>
        <asp:Label ID="LResult" runat="server"></asp:Label>
    </div>
</asp:Content>

